package actionscript
{
	import spark.components.Button;
	import spark.components.Group;
	import spark.layouts.VerticalLayout;

	public class SimpleExample extends Group
	{
		private var _clickMe:Button = new Button();
		
		public function SimpleExample()
		{
			super();
			this.init();
		}
		
		private function init():void
		{
			super.layout = new VerticalLayout();
			this._clickMe.label = "Click me!";
		}
		
		public override function validateDisplayList():void
		{
			// This is the common (and recommended) practice
			// however, as it happens with most of other Flex
			// recommendations, it's not good because certain
			// methods can be called on this component before
			// the child is added. This is why many prefer to
			// add all children in the constructor.
			super.addElement(this._clickMe);
			super.validateDisplayList();
		}
	}
}